<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="com.power.util.RequestUtil" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	Integer oRid = RequestUtil.getParam(request, "oRid", 0);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=basePath%>resources/css/simulateExtTemplete.css" type="text/css"></link>
<script charset="utf-8" src="../scripts/kindeditor-4.1/kindeditor-min.js"></script>
<script type="text/javascript" src="<%=basePath%>scripts/jquery-1.4.2.js"></script>
<script type="text/javascript" src="<%=basePath%>scripts/apputil.js"></script>
<title>梦房园金融</title>
<style type="text/css">
	html,body{height: 100%;width: 100%;overflow: auto;padding: 0;margin: 0;}
	body{background: url("resources/img/bg.png");}
	div,span,a,li,td{font-family: "宋体";}
	.common_top{height: 50px;line-height: 50px;background:#CF3128;width: 100%;}
	.common_top td{color: #fff;font-size: 14px;font-family: "宋体"}
	.common_top ul,.common_top li{padding: 0;margin: 0;list-style: none;height: 50px;}
	.common_top li{float: left;margin-left: 30px;}
	.common_top li .curr{background: #A81F0E;}
	.common_top li a{font-size: 16px;letter-spacing: 1px;color: #fff;text-decoration: none;height: 50px;line-height: 50px;display: -moz-inline-box;display: inline-block;padding-left: 10px;padding-right: 10px;}
	.common_top .logo{font-size: 18px;font-family: "微软雅黑";font-style: italic;}
	.common_top .f{font-size: 13px;}
	.common_top .f a{margin-right: 15px;text-decoration: none;}
	.common_top .f a:link{color: #fff;}
	.common_top .f a:visited{color: #fff;}
	.common_top .f a:hover {color:#DA9133;text-decoration: underline;}
	.common_w{width: 1024px;}
	.common_w2{width: 764px;}
	.common_w3{width: 240px;}
	.common_split{margin-left: 20px;}
	.common_mp{margin-top: 20px;}
	.hot_p{width: 100%;height: 150px; background: #fff;}
	.zz{width: 100%;background: #fff; height: 50px;}
	.zz span{display: -moz-inline-box;display: inline-block;
		background:#F99C08;color:#fff;
		height: 30px;line-height: 30px;
		width: 105px;margin-top: 10px;margin-left: 20px;font-size: 15px;cursor: pointer;
	}
	.zz span:link{background:#F99C08;}
	.zz span:visited{background:#F99C08;}
	.zz span:hover{background: #F56D01}
	.t1{font-family: "微软雅黑";font-size: 15px;height: 30px;width: 100%;padding-left: 10px;}
	.t1 span{display: -moz-inline-box;display: inline-block;margin-top: 10px ;height: 20px;line-height: 20px;float: left;font-family: "微软雅黑";font-size: 16px;margin-left: 10px;font-weight: 600;}
	.t1 .icon{background: #F27676;width: 20px;}
	.t1 .icon2{background: #6FD3DB;width: 20px;}
	.footer{width: 100%;background: #F3F3F3;height: 100px;clear: both;float: left;border-top: 1px solid #CDCDCD;}
	.footer td{color: #6C6C6C;}
	.footer td a{text-decoration: none; color: #6C6C6C;font-size: 13px;display: -moz-inline-box;display: inline-block;letter-spacing: 1px;}
	.footer td a:link{color: #6C6C6C;}
	.footer td a:visited{color: #6C6C6C;}
	.footer td a:hover {color:#DA9133;text-decoration: underline;}
	.footer table .logo{font-size: 25px;font-weight: 600;font-style: italic;}
	.footer table .copy{font-size: 13px;font-style: italic;}
</style>
<script type="text/javascript" src="scripts/jquery-1.6.1.js"></script>
<script type="text/javascript" src="scripts/jquery.scrollFix.js"></script>
</head>
<body onkeydown="EnterToTab();">
<div class="common_top" align="center">
	<table cellpadding="0" cellspacing="0" class="common_w" border="0">
		<tr><td align="left" class="logo" >梦房园金融</td><td>
		<ul>
			<li><a  href="../../rzProject/showProject.action">找项目</a></li>
			<li><a class="curr"  href="../../rzMoneyside/showFunding.action">找资金</a></li>
			<li><a href="#">投资理财</a></li>
		</ul>
		</td><td align="right" class="f"><a href="#">收藏本站</a><a href="#">设为首页</a></td></tr>
	</table>
</div>
<center>
<form id="myForm" name="myForm" method="post" target="tempFrame"
	action="../rzMoneyside/save.action" enctype="multipart/form-data">
	<input type="hidden" value="0" name="obj.sourceType" id="sourceType"/>
	<table width="80%" cellpadding="5" cellspacing="0" border="0" class="tabCls">
		<tr> 
			<td class="titleBack tdT tdL" width="100px;">资方名称:</td>
			<td class="tdL tdT tdR titleBack1" colspan="3">
				<input class="inputCls100_100" id="name" name="obj.name"  value="<s:property value="obj.name" />"  />
			</td>
		</tr>
		<tr> 
			<td class="titleBack tdT tdL  ">投资方式:</td>
			<td class="tdL tdT titleBack1 " >
				<SELECT id="investmentType" name="obj.investmentType" onchange="typeChange(this.value);" class="loginInput"></SELECT>
			</td>
			<td class="titleBack tdT tdL" >资金主体:</td>
			<td class="tdL tdT tdR titleBack1" >
				<SELECT id="moneyObj" name="obj.moneyObj" class="loginInput"></SELECT>
			</td>
		</tr>
		<tr>
			<td class="titleBack tdT tdL  ">所在地区:</td>
			<td class="tdL tdT titleBack1 " >
				<input class="inputCls220" id="place" name="obj.place"  value="<s:property value="obj.place" />"   />
			</td>
			<!--  
				<td class="titleBack tdT tdL  ">资金类型:</td>
				<td class="tdL tdT titleBack1 " >
					<SELECT id="mtype" name="obj.mtype" class="loginInput"></SELECT>
				</td>
			 -->
			<td class="titleBack tdT tdL  ">投资行业:</td>
			<td class="tdL tdT titleBack1 tdR" >
				<SELECT id="industry" name="obj.industry" class="loginInput"></SELECT>
			</td>
		</tr>
		<tr> 
			<td class="titleBack tdT tdL  ">投资地区:</td>
			<td class="tdL tdT   titleBack1" >
				<input class="inputCls220" id="investPlace" name="obj.investPlace"  value="<s:property value="obj.investPlace" />"   />
			</td>
			<td class="titleBack tdT tdL  ">投资金额:</td>
			<td class="tdL tdT tdR titleBack1" >
				<input class="inputCls220" id="investMoney" name="obj.investMoney"  value="<s:property value="obj.investMoney"/>" />
			</td>
		</tr>
		<tr id="hide0"> 
			<td class="titleBack tdT tdL  ">最低回报要求:</td>
			<td class="tdL tdT titleBack1 tdR" colspan="3">
				<input class="inputCls80" id="returnRate" name="obj.returnRate"  onkeydown="onlyNum();" value="<s:property value="obj.returnRate" />" />&nbsp;%/年
			</td>
		</tr>
		<tr id="hide1"> 
			<td class="titleBack tdT tdL  ">投资期限:</td>
			<td class="tdL tdT tdR titleBack1" colspan="3">
				<input class="inputCls220" id="investTime" name="obj.investTime"  value="<s:property value="obj.investTime"/>" />
			</td>
		</tr>
		<tr> 
			<td class="titleBack tdT tdL">联系人:</td>
			<td class="tdL tdT titleBack1">
				<input class="inputCls220" id="linkman" name="obj.linkman"  value="<s:property value="obj.linkman" />"   />
			</td>
			<td class="titleBack tdT tdL ">联系电话:</td>
			<td class="tdL tdT tdR titleBack1" >
				<input class="inputCls220" id="linkphone" name="obj.linkphone"  value="<s:property value="obj.linkphone"/>" />
			</td>
		</tr>
		<tr id="hide3">
			<td class="titleBack tdT tdL">风控要求:</td>
			<td class="tdL tdT titleBack1 tdR" colspan="3">
				<input class="inputCls220" id="riskRequire" name="obj.riskRequire"  value="<s:property value="obj.riskRequire" />"   />
			</td>
		</tr>
		<tr id="hide4">
			<td class="titleBack tdT tdL">风险偏好:</td>
			<td class="tdL tdT titleBack1">
				<input class="inputCls220" id="riskPreference" name="obj.riskPreference"  value="<s:property value="obj.riskPreference" />"   />
			</td>
			<td class="titleBack tdT tdL  ">产品偏好:</td>
			<td class="tdL tdT titleBack1 tdR" >
				<input class="inputCls220" id="productPreference" name="obj.productPreference"  value="<s:property value="obj.productPreference" />"   />
			</td>
		</tr>
		<tr id="hide5">
			<td class="titleBack tdT tdL  ">股权投资类型:</td>
			<td class="tdL tdT titleBack1 " >
				<input class="inputCls220" id="stockInvest" name="obj.stockInvest"  value="<s:property value="obj.stockInvest" />"   />
			</td>
			<td class="titleBack tdT tdL">投资阶段:</td>
			<td class="tdL tdT titleBack1 tdR">
				<input class="inputCls220" id="investStage" name="obj.investStage"  value="<s:property value="obj.investStage" />"   />
			</td>
		</tr>
		<tr>
			<td class="titleBack tdT tdL" >附件：</td>
			<td class="tdL tdT titleBack1 tdR" colspan="3" ><input type="file" name="imgFile" id="img" size="80"/></td>
		</tr>
		<tr>
			<td class="titleBack tdL tdT tdB ">信息概述:</td>
			<td class="tdR tdL tdT tdB" colspan="3">
				<textarea style="width:99%;height:220px;word-wrap:break-word;" name="obj.remark" id="content1"><s:property value="obj.remark" /></textarea>
	    	</td>
		</tr>
	</table>
	<%if(0==oRid){ %>
	<table width="80%" class="tabCls">
		<tr>
			<td align="center">
				<div class="zz">
						<span onclick="checkForm();">保 存</span>
						<span onClick="javascript:window.location.href='../mainPage.jsp';">取 消</span>
				</div>
			</td>
		</tr>
	</table>
	<%} %>
	<iframe id="tempFrame" name="tempFrame" style="display:none;"></iframe>
</form>

</center>
<div class="footer common_mp" align="center">
	<table cellpadding="0" cellspacing="0" class="common_w" height="80%" border="0">
		<tr><td class="logo" width="200px" rowspan="2" valign="middle"><img onclick="window.location.href='http://jr.mymfy.com'" src="../resources/images/mfy/logo.png"></td>
		<td align="left">
		<a href="http://jr.mymfy.com/about.html">关于我们</a>
		<a href="http://jr.mymfy.com/comm.html">联系我们</a>
		<a href="http://jr.mymfy.com/service.html">服务介绍</a>
		<a href="http://jr.mymfy.com/case.html">案例赏析</a>
		</td>
		</tr>
		<tr>
		<td class="copy">Copyright © 2013 mymfy.com All Rights Reserved. 苏ICP备13024701号.</td></tr>
	</table>
</div>
</body>
<script>

var investmentTypeval = '${obj.investmentType}';
typeChange(investmentTypeval);
	function typeChange(v){
		if(v=='金融投资'){
			$("#hide4").show();
			
			$("#hide0").hide();
			$("#hide1").hide();
			$("#hide2").hide();
			$("#hide3").hide();
			$("#hide5").hide();
		}
		if(v=='债权投资'){
			$("#hide0").show();
			$("#hide1").show();
			$("#hide3").show();
			
			$("#hide2").hide();
			$("#hide4").hide();
			$("#hide5").hide();
		}
		if(v=='股权投资'){
			$("#hide1").show();
			$("#hide5").show();
			
			$("#hide0").hide();
			$("#hide2").hide();
			$("#hide3").hide();
			$("#hide4").hide();
		}
		if(v=='BT/BOT项目投资'){
			$("#hide0").hide();
			$("#hide1").hide();
			$("#hide2").hide();
			$("#hide3").hide();
			$("#hide4").hide();
			$("#hide5").hide();
		}
		if(v=='其它投资'){
			$("#hide0").hide();
			$("#hide1").hide();
			$("#hide2").hide();
			$("#hide3").hide();
			$("#hide4").hide();
			$("#hide5").hide();
		}
	}
	
	function checkForm(){
		var name = $("#name");
	    if (name.val()=="") {
	        alert("请填写资方名称！")
	        name.focus();
	        return false;
	    }

		var investmentType = $("#investmentType");
	    if (investmentType.val()=="") {
	        alert("请选择投资方式！")
	        investmentType.focus();
	        return false;
	    }
	    
	    var moneyObj = $("#moneyObj");
	    if (moneyObj.val()=="") {
	        alert("请选择资金主体！")
	        moneyObj.focus();
	        return false;
	    }
	    
	    var mtype = $("#mtype");
	    if (mtype.val()=="") {
	        alert("请选择资金类型！")
	        mtype.focus();
	        return false;
	    }
	    
	    var industry = $("#industry");
	    if (industry.val()=="") {
	        alert("请选择投资行业！")
	        industry.focus();
	        return false;
	    }
  
		var linkman = $("#linkman");
	    if (linkman.val()=="") {
	        alert("请填写联系人！")
	        linkman.focus();
	        return false;
	    }
	    
	    var linkphone = $("#linkphone");
	    if (linkphone.val()=="") {
	        alert("请填写联系电话！")
	        linkphone.focus();
	        return false;
	    }
    	document.forms[0].submit();
	}
	
	function saveResult(items){
		if(items=='y')
			alert('保存成功！');
		else if(items=='n')
			alert('保存失败，请稍候再试！');
		else 
			alert('未知错误，请稍候再试！');
		window.location.href='../mainPage.jsp';
	}
	//资金类型
	var mtype = '${obj.mtype}';
	$.get('../dataPlugin/buildJsonData.action?tablename=zjlx',function(mes){
		var mesJson = eval('('+mes+')');
		var disJson = mesJson[0]['result'];
		initSelect('mtype',disJson,mtype,function(){});
	})
	//资金主体
	var moneyObj = '${obj.moneyObj}';
	$.get('../dataPlugin/buildJsonData.action?tablename=rzzt',function(mes){
		var mesJson = eval('('+mes+')');
		var disJson = mesJson[0]['result'];
		initSelect('moneyObj',disJson,moneyObj,function(){});
	})
	//投资行业
	var industry = '${obj.industry}';
	$.get('../dataPlugin/buildJsonData.action?tablename=tzhy',function(mes){
		var mesJson = eval('('+mes+')');
		var disJson = mesJson[0]['result'];
		initSelect('industry',disJson,industry,function(){});
	})
	//投资方式
	var investmentType = '${obj.investmentType}';
	$.get('../dataPlugin/buildJsonData.action?tablename=tzfs',function(mes){
		var mesJson = eval('('+mes+')');
		var disJson = mesJson[0]['result'];
		initSelect('investmentType',disJson,investmentType,function(){});
	})

var editor;
        KindEditor.ready(function(K) {
		               editor = K.create('#content1', {
		               allowFileManager : true,
		               uploadJson : '../scripts/kindeditor-4.1/upload_json.jsp',
				       fileManagerJson : '../scripts/kindeditor-4.1/file_manager_json.jsp',
				          afterBlur:function(){ 
				            this.sync(); 
				        },  
                       items : [
					 	           'preview','source', '|', 'undo', 'redo', '|',  'cut', 'copy', 'paste',
						        'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
						        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
						        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
						        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
						        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
						       'insertfile', 'table', 'hr', 'emoticons', 'map', 'pagebreak',
						        'link', 'unlink'
                  ]
                        
                });
        });
</script>
</html>